home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
harderr.arc
/
INT24.ASM
< prev
next >
Wrap
Assembly Source File
|
1991-10-12
|
2KB
|
103 lines
;Module Name : INT24.ASM
;Author : Bill Buckels
;Date : October 3, 1991
;Purpose : Hard Error ISR Function
; for Large Model Microsoft C Version 5.1
; Written in MASM version 5.1
; From an Outline Generated By The MSC Compiler
INT24_TEXT SEGMENT WORD PUBLIC 'CODE'
INT24_TEXT ENDS
_DATA SEGMENT WORD PUBLIC 'DATA'
_DATA ENDS
CONST SEGMENT WORD PUBLIC 'CONST'
CONST ENDS
_BSS SEGMENT WORD PUBLIC 'BSS'
_BSS ENDS
DGROUP GROUP CONST, _BSS, _DATA
ASSUME CS: INT24_TEXT, DS: DGROUP, SS: DGROUP
EXTRN _crit_error:BYTE
CONST SEGMENT
CRIT_SEG DW SEG _crit_error
CONST ENDS
INT24_TEXT SEGMENT
ASSUME CS: INT24_TEXT
;logical value
TRUE = 1
;offsets into our global hard error structure
HARDSTATUS = 0
HERRNO = 2
DEVICE_SEG = 4
DEVICE_OFF = 6
IO_STATUS = 8
; action codes to return from the int24 ISR
IGNORE_ERROR = 0
RETRY_OPERATION = 1
TERMINATE_PROGRAM = 2
FAIL_SYSTEM_CALL = 3
PUBLIC _int24
_int24 PROC FAR
push ax ;save the registers
push cx
push dx
push bx
push sp
push bp
push si
push di
push ds
push es
mov bx,bp ;save bp in bx in case we have a driver error
mov cx,si ;save si in cx for the same reason
mov dx,ax ;save the error status in dx
mov ax,DGROUP
mov ds,ax
ASSUME DS: DGROUP
mov ax,di ;put the action code in ax
cld
;--------------------------------------------------------
;put the hard error information into a global structure
;then resume the program.
;--------------------------------------------------------
mov es,CRIT_SEG
mov WORD PTR es:_crit_error+HARDSTATUS,TRUE
mov WORD PTR es:_crit_error+HERRNO, ax
mov WORD PTR es:_crit_error+DEVICE_SEG,bx
mov WORD PTR es:_crit_error+DEVICE_OFF,cx
mov BYTE PTR es:_crit_error+IO_STATUS, dh
pop es
pop ds
ASSUME DS: DGROUP
pop di
pop si
pop bp
pop bx
pop bx
pop dx
pop cx
pop ax
mov ax,IGNORE_ERROR
iret
_int24 ENDP
nop
INT24_TEXT ENDS
END